#include <iostream>
#include <vector>

int main() {
    std::vector<int> nums = {1, 2, 3, 4, 5};
    int sum = 0;
    
    for (int i = 0; i < nums.size(); i++) {
        for (int j = i; j < nums.size(); j += 2) {
            for (int k = i; k <= j; k++) {
                sum += nums[k];
            }
        }
    }
    
    std::cout << "Sum of all odd length subarrays: " << sum << std::endl;
    
    return 0;
}
